<link rel="stylesheet" href="/opebs/css/bootstrap.min.css">
<link href="/bootstrap-fileinput-master/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
<script src="/opebs/js/jquery.min.js"></script>
<script src="/bootstrap-fileinput-master/js/fileinput.js" type="text/javascript"></script>
<script src="/bootstrap-fileinput-master/js/locales/zh.js" type="text/javascript"></script>
<body>
<div class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-project-add">
        <table class="table table-border table-bordered table-bg">
            <tbody id="good">
                <#if docTypeList??>
                    <#list docTypeList as docs>
                        <tr>
                            <td colspan="3">
                                <label class="control-label">${docs.typeCN}</label>
                                <input class="fileInputUpload" id="inputB1"  name="${docs.typeCN}" type="file" multiple >
                            </td>
                        </tr>
                    </#list>
                </#if>
            </tbody>
        </table>
    </form>
    <#--<form action="" method="post" class="form form-horizontal"  method="post" name="good-form" id="good-form">-->
        <#--<table class="table table-border table-bordered table-bg">-->
            <#--<thead>-->
            <#--<tr>-->
                <#--<th colspan="6" scope="col">自定义文件-->
                    <#--<input class="btn btn-primary radius" type="button" value="添加" id="add-good" style="margin-left: 20px">-->
                    <#--<input class="btn btn-primary radius" type="button" value="删除" id="remove-good" style="margin-left: 20px">-->
                <#--</th>-->
            <#--</tr>-->
            <#--<tr class="text-c">-->
                <#--<th colspan="2">文件描述</th>-->
                <#--<th colspan="2">文件上传</th>-->
            <#--</tr>-->
            <#--</thead>-->
            <#--&lt;#&ndash;<tbody id="good"></tbody>&ndash;&gt;-->
        <#--</table>-->
    <#--</form>-->
</div>
</body>
<script>
    $("#add-good").click(function(){
        $("#good").append('' +
                '<tr>' +
                // '<td colspan="2">' +
                // '   <input type="text" placeholder="" class="input-text" nullmsg="货物名称不能为空" datatype="*2-12" errmsg="请输入2到12位" >' +
                // '</td>' +
                '<td colspan="3"><label class="control-label">aaa</label><input class="fileInputUpload" id="inputB1"  name="aa" type="file" multiple ></td>' +
                '</tr>');
    });
    $('#remove-good').click(function () {
        var rows = $('#good').find('tr');
        if(0!=rows.length){
            rows[rows.length - 1].remove();
        }
    })
</script>
<script>
    var url = "/upload-json/"+'${location}'+"/"+${id};
    $(".fileInputUpload").fileinput({
        language: 'zh',
        showBrowse: true,
        uploadUrl : url,//图片上传的url，我这里对应的是后台struts配置好的的action方法
        enctype: 'multipart/form-data',
        showCaption: true,
        showPreview: false,
        previewZoomButtonClasses:'',
        preferIconicZoomPreview:false,
        theme: "explorer",
        dropZoneEnabled: false

    }).on('filepreupload', function(event, data, previewId, index){//上传中
    }).on("fileuploaded", function (event, data, previewId, index) {    //一个文件上传成功
    }).on('fileerror', function(event, data, msg) {  //一个文件上传失败
        console.log('文件上传失败！' + msg);
    })
</script>
